﻿/*****************************************************************************/
/* Stored Procedure :: ApplicationShutdown                                   */
/*****************************************************************************/
/* Copyright (C) 2003-2004, Perot Systems Corporation. All right reserved.   */
/* Developer: Dima Frenkel (dima.frenkel@ps.net)                             */
/* Started:  08/04/2004                                                      */
/*****************************************************************************/
CREATE PROCEDURE [Kernel].[ApplicationShutdown]( 
	@OID BIGINT,
	@FinishTime datetime = null
)
AS 
BEGIN
  SET @FinishTime = ISNULL( @FinishTime, GETDATE() )
  
  UPDATE ApplicationLog
     SET FinishTime = @FinishTime
   WHERE OID = @OID AND FinishTime IS NULL
END


